package com.lantu.wisdom.controller;

import com.lantu.framework.common.utils.ResponseWrapper;
import com.lantu.wisdom.common.utils.CreateCodeUtil;
import com.lantu.wisdom.dto.PlaceOrderDTO;
import com.lantu.wisdom.service.PayDetailApi;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @Author: duhui
 * @Date: 2020/8/10 17:39
 */
@Slf4j
@RestController
@RequestMapping("/pay")
@Api(tags = {"支付相关接口"})
public class PayAppController {


    @Autowired
    PayDetailApi payDetailApi;



    @ApiOperation(value = "充值下单接口")
    @RequestMapping(value = "/placeOrder", method = RequestMethod.POST)
    public ResponseWrapper placeOrder(@RequestBody PlaceOrderDTO placeOrderDTO) {
        //todo  duihui 参数少openId
        String orderCode =CreateCodeUtil.createOrderCode();
        payDetailApi.addActivityUserBill(placeOrderDTO,orderCode);
        return ResponseWrapper.success(orderCode);

    }
}
